package com.zdx.yswl.ui.bean;

import org.json.JSONException;
import org.json.JSONObject;

import com.zdx.yswl.tool.KStringTool;

public class DetailedInforBean extends BaseBean{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3234403944632465614L;
	/**
	 *  入住时间
	 */
	public String startTime;
	/**
	 *  产权年限
	 */
	public String propertyRightVintage;
	/**
	 *  装修状态 /描述
	 */
	public String state;
	/**
	 *  物业费用
	 */
	public String propertyCosts;
	/**
	 *  物业类型
	 */
	public String propertyType;
	/**
	 *  建筑类别
	 */
	public String buildingType;
	/**
	 *  住户数量
	 */
	public String householdNum;
	/**
	 *  容积率
	 */
	public String plotAtio;
	/**
	 *  绿化率
	 */
	public String greeningRate;
	/**
	 *  停车位
	 */
	public String parkingSpace;
	/**
	 *  开发商
	 */
	public String developer;
	/**
	 *  预售许可证 ？？？图片
	 */
	public String salePermit;// url
	/**
	 *  物业公司
	 */
	public String propertyCompany;

	public static DetailedInforBean getBeanFromJSON(String json) throws JSONException {
		DetailedInforBean bean = new DetailedInforBean();
		JSONObject jsonObj = new JSONObject(json);
		bean.startTime = jsonObj.getString("finishTime");
		bean.propertyRightVintage = jsonObj.getString("ownYear");
		bean.state = jsonObj.getString("decoration");
		bean.propertyCosts = jsonObj.getString("propertyFee");
		bean.propertyType = jsonObj.getString("propertyType");
		bean.buildingType = jsonObj.getString("buildType");
		bean.householdNum = jsonObj.getString("houseHolder");

		bean.plotAtio = jsonObj.getString("spaceRatio");
		bean.greeningRate = jsonObj.getString("greenRatio");
		bean.parkingSpace = jsonObj.getString("parkNum");
		bean.developer = jsonObj.getString("developerName");

		String sale = jsonObj.getString("preLisence");
		if (KStringTool.isEmpty(sale)) {
			sale = "暂无";
		}
		bean.salePermit = sale;
		String company = jsonObj.getString("propertyCompany");
		if (KStringTool.isEmpty(company)) {
			company = "暂无";
		}
		bean.propertyCompany = company;

		return bean;

	}

}
